<template>
    <div class="profile">
        <div class="header">个人资料</div>
        <div class="title">这里是修改后的个人资料信息</div>
        <div class="content">
            <!-- 昵称 -->
            <div class="item">
                昵称：<div class="profileData">{{ profileData?.name }}</div>
            </div>
            <!-- 邮箱 -->
            <div class="item">
                邮箱：<div class="profileData">{{ profileData?.email }}</div>
            </div>
            <!-- 手机号 -->
            <div class="item">
                手机号：<div class="profileData">{{ profileData?.phone }}</div>
            </div>
            <!-- 地址 -->
            <div class="item">
                地址：<div class="profileData">{{ profileData?.address }}</div>
            </div>
            <!-- 留言 -->
            <div class="item">
                留言：<div class="profileData">{{ profileData?.message }}</div>
            </div>
        </div>
        <button class="turnBack" @click="$router.push('/owner')">返回</button>
    </div>
</template>

<script setup>
import { ref, onMounted } from "vue";   

const profileData = ref({});

// 从localstorage中获取数据，getItem
onMounted(()=>{
    profileData.value = JSON.parse(localStorage.getItem("profileData")) || {};
})
</script>

<style lang="css" scoped>
* {
    margin: 0;
    padding: 0;
}

.profile {
    font-family: Arial, Helvetica, sans-serif;
    text-align: center;
}

.header {
    font-size: 24px;
    /* font-weight 字体的粗细 */
    font-weight: bold;
    text-align: center;
    margin: 10px 0px 10px 0px;
    color: blue;
}

.title {
    font-size: 14px;
    color: rgb(168, 168, 168);
    text-align: center;
    margin-bottom: 10px;
}

.content {
    padding: 10px;
    width: 100%;
    /* display：flex、grid与align-items配合使用*/
    display: flex;
    align-items: center;
    flex-direction: column;
    background-color: #fff;
}

.item {
    padding: 20px 0 20px 0;
    display: flex;
    font-size: 20px;
}

.profileLink{
    color: rgb(93, 100, 107);
}

.turnBack {
    width: 180px;
    height: 45px;
    background: linear-gradient(135deg, #e0fde1, #81C784);
    font-size: 20px;
    border-radius: 20px;
}
</style>